<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>反转数字字符</title>
	</head>
	<body>
		
		<script>
			//  123 ===> 321
			
			let num = prompt('请输入数字',123);
			/* 		
			let b = num[0];
			let s = num[1];
			let g = num[2];
			 */
			
			//获取百位
			let b = parseInt(num/100) ;
			//获取十位
			let s =  parseInt(num/10) % 10 ;
			//获取个位
			let g = num % 10;
			
			console.log(g*100 + s*10 + b);
			
		</script>
	</body>
</html>